function ProtectionActRatio(ratios){
	var pieId = ObjectId.guid();
	var pie;
	var faultSum = undefined;
	this.setRatios = function(d){
		ratios = d;
		return this;
	};
	this.setFaultSum = function(sum){
		faultSum = sum;
		return this;
	};
	this.setPieChartId = function(id){
		pieId = id;
		return this;
	};
	this.drawDiv = function(div){
		if(faultSum){
			var r = 100;
			var data = [];
			if(ratios[3] > 0 ){
				r = ratios[3] == 0?1:ratios[0]/ratios[3];
				r = (r*100).toFixed(2);
				data = [['正确动作',ratios[0]],['误动',ratios[1]],['拒动',ratios[2]]];
			}else{
				data = [['正确动作',1]];
			}
			var s = '';
			if(faultSum != undefined){
				s += "共计故障<span style='font-size:22px;margin:3px;color:red;'>"+faultSum+"</span>次，";
			}
			s += "保护动作正确率：<i style='font-size:22px;color:green;'>"+r+"%</i>";
			div.append(PanelTablesUtil.getLi(s));
			var pieDiv = $('<div id="'+pieId+'" style=" height:250px;width:300px"></div>');
			div.append(pieDiv);
			pie = new Pie(pieDiv);
			pie.setPie(data);
			pie.setColors(['#00a65a','#c00','orange']);
			pie.setPieOuterRadius('40%');
			pie.setLegendPosition('right', 'bottom');
			var opt = pie.getOption();
			opt.toolbox.show = false;
			opt.series[0].startAngle = -90;
			opt.tooltip.formatter = function(params){
				if(ratios[3]>0){
					return params.name+"："+params.value;
				}else{
					return params.name+"：-";
				}
			};
			pie.show();
		}else{
			div.append(PanelTablesUtil.getSmileInfo("无相关故障"));
		}
	};
	this.showPie = function(){
		if(pie){
			pie.show();
		}
	};
}